#pragma once

#include <stdio.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <fcntl.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>

#define SIZE 4096
#define NONE_FLUSH (1<<1)
#define LINE_FLUSH (1<<2)
#define FULL_FLUSH (1<<3)

typedef struct _myFile
{
   // char inbuffer[];
    char outbuffer[SIZE];
    int fileno;
    int pos;//当前位置
    int cap;//当前容量
    int flush_mode;
}myFILE;

myFILE* my_fopen(const char* pathname, const char* mode);
int my_fwrite(myFILE* fp, const char* s, int size);
//int my_fread();
void my_fflush(myFILE* fp);
void my_fclose(myFILE* fp);
void DebugPrint(myFILE* fp);
